package controleur;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import vue.VRootWindow;
import vue.VTheme;

public class CNewLevel implements MouseListener, ActionListener {
	
	protected VTheme themeWin; //Reference sur la fenetre appellante (fermeture)
	protected VRootWindow rootWin; //Reference sur la fenetre principale pour construire le niveau
	protected int lvl; //Niveau choisi
	protected int th; //Theme choisi
	
	public CNewLevel(VTheme tw, VRootWindow rw, int choixlvl, int theme) {
		themeWin = tw;
		rootWin = rw;
		lvl = choixlvl;
		th = theme;
	}
	
	@Override
	public void mouseReleased(MouseEvent arg0) {
		rootWin.buildLvl(lvl, th);
		themeWin.quit();
	}
	
	@Override
	public void mouseClicked(MouseEvent arg0) {}
	@Override
	public void mouseEntered(MouseEvent arg0) {}
	@Override
	public void mouseExited(MouseEvent arg0) {}
	@Override
	public void mousePressed(MouseEvent arg0) {}

	@Override
	public void actionPerformed(ActionEvent arg0)
	{
		// TODO Auto-generated method stub
	
		rootWin.reBuildLvl(lvl, th);
	}
	
}
